$(function(){
	$("#Previous").click(function(){		
		var firstPage = $(".pagination>li.active").prev().find("a").eq(0).html();
		var first = $(".pagination .data:first a").html();
		var activepage = $(".pagination .active a").html();
		if(first==activepage){
			alert("已经是第一页了")
		}else{
			window.location.href="/film/showOffTheShelifhotFilmPage.do?page="+firstPage+"&isDelete=1";
		}
		
	})
	$("#li").click(function(){
		var lastPage = $(".pagination>li.active").next().find("a").eq(0).html();
		var first = $(".pagination .data:last a").html();
		var activepage = $(".pagination .active a").html();
		if(first==activepage){
			alert("已经是最后一页了")
		}else{
			window.location.href="/film/showOffTheShelifhotFilmPage.do?page="+lastPage+"&isDelete=1";
		}
		
	})
	
	var btn = $("#table .btn");
	for(var i = 0;i<btn.length;i++){
		btn.eq(i).click(function(){
			var xaijia = $(this).find("span").html();
			if(xaijia == "上架"){
				var filmId = $(this).parents("tr").find(".filmId").html();
				window.location.href="/film/showUpOffTheShelfFilm.do?filmId="+filmId;
			}
		})
	}
	$("#butupdate").click(function(){
		window.location.href="/film/showFilmExhibition.do";
	})
})